﻿<navigation:Page x:Class="SilverlightAsyncSave.Home" 
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:navigation="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Navigation"
    mc:Ignorable="d" d:DesignWidth="640" d:DesignHeight="480"
    Title="Home"
    Style="{StaticResource PageStyle}">

   <navigation:Page.Resources>
   	<Style x:Key="Header" TargetType="TextBlock">
         <Setter Property="FontSize" Value="12"/>
         <Setter Property="Margin" Value="10, 5, 0, 10" />
      </Style>
      <Style x:Key="ButtonStyle" TargetType="Button">
         <Setter Property="Height" Value="20" />
         <Setter Property="Width" Value="76" />
         <Setter Property="Margin" Value="10" />
      </Style>
   </navigation:Page.Resources>

   <Grid x:Name="LayoutRoot">
      <StackPanel x:Name="ContentStackPanel">

         <TextBlock x:Name="HeaderText" Style="{StaticResource HeaderTextStyle}"  Text="Home"/>
         <Grid>
            <Grid.ColumnDefinitions>
               <ColumnDefinition Width="Auto" />
               <ColumnDefinition Width="*" />
               <ColumnDefinition Width="Auto"/>
               <ColumnDefinition Width="*"/>
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
               <RowDefinition Height="Auto" />
               <RowDefinition />
               <RowDefinition Height="*" />
            </Grid.RowDefinitions>

            <TextBlock Grid.Row="0" Grid.Column="0" Text="Synchronisely" Style="{StaticResource Header}" />
            <TextBlock Grid.Row="0" Grid.Column="2" Text="Asynchronisely" Style="{StaticResource Header}" />
            
            <TextBlock Grid.Row="1" Grid.Column="0" Text="Files:" HorizontalAlignment="Right" />
            <TextBlock Grid.Row="1" Grid.Column="2" Text="Files:" HorizontalAlignment="Right" />

            <ListBox x:Name="FilesSync" Grid.Row="1" Grid.Column="1" MinHeight="100" SelectionMode="Single" ItemsSource="{Binding FileItems, Mode=TwoWay}" SelectedItem="{Binding SelectedFile, Mode=TwoWay}" />
            <ListBox x:Name="FilesAsync" Grid.Row="1" Grid.Column="3" MinHeight="100" SelectionMode="Single" ItemsSource="{Binding FileItems, Mode=TwoWay}" SelectedItem="{Binding SelectedFile, Mode=TwoWay}" />
            
            <TextBox x:Name="FileNameSync" Grid.Row="2" Grid.Column="1" VerticalAlignment="Stretch" />
            <TextBox x:Name="FileNameAsync" Grid.Row="2" Grid.Column="3" />
            
            <Button Grid.Row="2" Grid.Column="0" Content="Save" Style="{StaticResource ButtonStyle}" Click="SaveSync_Click"/>
            <Button Grid.Row="2" Grid.Column="2" Content="Save" Style="{StaticResource ButtonStyle}" Click="SaveAsync_Click"/>
         </Grid>
      </StackPanel>
   </Grid>

</navigation:Page>